home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / misc / emu / APCNames12a.lha / APCNames / Sources.Amiga / MkTestfile.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-07  |  420 b   |  26 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6.   char fn[80];
  7.   int i,n;
  8.   FILE *fp;
  9.  
  10.   if(--argc < 1) {
  11.     printf("number of files required !\n");
  12.     exit(EXIT_FAILURE);
  13.   }
  14.  
  15.   n = atoi(argv[1]);
  16.   for(i=0; i<n; i++) {
  17.     sprintf(fn,"Testfile%d.txt",i);
  18.     if(!(fp = fopen(fn,"w"))) {
  19.       printf("cannot open %s !\n",fn);
  20.       continue;
  21.     }
  22.     fputc('X',fp);
  23.     fclose(fp);
  24.   }
  25. }
  26.